def isPerfectNumber(n):
    s=0
    for i in range(1,n):   
     if n%i==0:
        s=s+i
    if s==n:
        return True
    else:
        return False

n=eval(input("请输入一个正整数："))
print(isPerfectNumber(n))